cmake_minimum_required(VERSION 3.18)
project(OCT_EPA)

# 设置通用cmake
set( common_root
        ${CMAKE_CURRENT_SOURCE_DIR}/Common
)

set( common_output_root 
        ${CMAKE_CURRENT_SOURCE_DIR}
)

# 加载common 中的 cmake 脚本设置
set(common_cmake         ${common_root}/common.cmake)
set(linguist_cmake      ${common_root}/linguist.cmake)
include(${common_cmake})


# 1. 打开允许创建文件夹的开关
set_property(GLOBAL PROPERTY USE_FOLDERS ON)


# option 
option(oct_epa_enabled "OCT_EPA PROJECT IS ENABLED" ON)
option(oct_exe_dll_version_enabled "OCT_EPA PROJECT IS ENABLED" ON)


# 主工程
if (oct_epa_enabled)
        add_subdirectory("EPA")
endif(oct_epa_enabled)

# 动态库项目
if (oct_exe_dll_version_enabled)
        add_subdirectory("OctExeDllVersion")
endif(oct_exe_dll_version_enabled)


# 2. 把工程加到文件夹中
# set_target_properties(${PROJECT_NAME} PROPERTIES FOLDER "CMakeTargets")
# 3. 给 cmake 自动创建的工程重新命名, 默认名为 "CMakePredefinedTargets" 
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets")
